package com.InterestingExercises.电影信息系统Object_Oriented;

import java.util.Scanner;

/**
 * 用于测试电影信息系统
 */
public class Test {
    public static void main(String[] args) {
        Film[] films = new Film[4];
        /*for (int i = 0; i < films.length; i++) {
            films[i] = new Film(int id, String name, double price, double score, String director, String actor, String info);
        }*/
        films[0] = new Film(1, "水门桥", 38.9, 9.8, "徐克", "吴京", "12万人想看");
        films[1] = new Film(2, "出拳吧", 39, 7.8, "唐晓白", "田雨", "3.5万人想看");
        films[2] = new Film(3, "月球陨落", 42, 7.9, "罗兰", "贝瑞", "17.9万人想看");
        films[3] = new Film(4, "一点就到家", 35, 8.7, "许宏宇", "刘昊然", "10.8万人想看");

        FilmOperator fo = new FilmOperator(films);
        Scanner sc = new Scanner(System.in);
        boolean flag = true;
        System.out.println("╭───────────────────╮");
        System.out.println("│  电 影 信 息 系 统  │");
        System.out.println("╰───────────────────╯");
        while (flag) {
            System.out.println("╭───────────────────╮");
            System.out.println("│  1.查询全部电影信息  │");
            System.out.println("│───────────────────│");
            System.out.println("│  2.查询指定电影信息  │");
            System.out.println("│───────────────────│");
            System.out.println("│  3.退出系统         │");
            System.out.println("╰───────────────────╯");
            System.out.println("\n请您输入操作命令:");
            switch (sc.nextInt()) {
                case 1:
                    fo.showAllFilms();
                    break;
                case 2:
                    System.out.println("╭───────────────────╮");
                    System.out.println("│  请输入要查询的id:  │");
                    System.out.println("╰───────────────────╯");
                    int temp = sc.nextInt();
                    fo.searchFilmById(temp);
                    break;
                case 3:
                    flag = false;
                    System.out.println("╭───────────────────╮");
                    System.out.println("│    感谢使用,再见    │");
                    System.out.println("╰───────────────────╯");
                    break;
                default:
                    System.out.println("╭───────────────────╮");
                    System.out.println("│   输入有误,请重输   │");
                    System.out.println("╰───────────────────╯");
            }
        }


    }
}
